from rest_framework.views import APIView
from Common.api_response import JsonResponse


# 获取列表

# 新增
class AddEnvironments(APIView):
    def parameter_check(self, data):  #data怎么传过来的
        """校验数据
        环境名称env_desc
        环境地址address
        环境描述信息content
        
        """
        try:
            # 必填项
            if not data['env_desc'] or not data['address']:
                return JsonResponse(code="999995", msg="参数有误！")
        except KeyError:
            return JsonResponse(code="999995", msg="参数有误！")

    def post(self,request):
